Spetroscopic pH measurement using optimized mixtures of reagents to extend measurement range

ABSTRACT

An indicator mixture that allows pH measurement over a broader range of pH or to a higher accuracy than available using conventional spectroscopic techniques. In particular, the mixture of the present invention is comprised of two or more reagents such that when combined, the reagent mixture is capable of either detecting: (1) a pH range broader or more accurate than that the reagents individually, or (2) pH more accurately than the reagents individually. Also disclosed are methods of making and using the mixture.

The present invention claims priority to co-pending U.S. patentapplication Ser. No. 10/667,639 filed Sep. 22, 2003, entitled“Determining Fluid Chemistry of Formation Fluid by Downhole ReagentInjection Spectral Analysis,” which in turn claims priority toco-pending GB patent application no. 0227267.2 filed Nov. 22, 2002,entitled “Apparatus and Method for Analysing Downhole Water Chemistry.”Both of these patent applications are incorporated by reference hereinin their entireties.

FIELD OF THE INVENTION

The present invention relates to pH measurement of aqueous samples usingpH sensitive reagents (such as dyes) and, more particularly, to areagent mixture that allows accurate pH measurement over an extendedmeasurement range.

BACKGROUND

Spectroscopic (or calorimetric) method for pH measurement is awell-established technique, wherein a pH sensitive reagent (or dye)changes color based on the pH of the solution. The theory ofspectroscopic pH measurement using a single reagent indicator is wellknown (see Bates, “Determination of pH: Theory and Practice” Chapter 6(1964), incorporated by reference herein in its entirety) and can becharacterized by the following equation:

$\begin{matrix}{{pH} = {{pKa} + {\log\;\frac{\gamma_{B}}{\gamma_{A}}} + {\log\;\frac{B}{A}}}} & (1)\end{matrix}$where Ka is the thermodynamic acid dissociation constant for thereagent, which is a function of temperature and pressure; A, B areconcentrations of the acid and base forms of the reagent, respectively;γ_(A), γ_(B) are activity coefficients of the acid and base forms of thereagent, respectively, which are a function of temperature, pressure andionic strength of the solution.

The ratio of the base form to the acid form (B/A) of the reagentindicator may be calculated from spectral measurements using thefollowing equations:C _(T) =A+B  (2)OD ^(λ1) =ε _(A) ^(λ1) lA+ε _(B) ^(λ1) lB  (3)OD ^(λ2) =ε _(A) ^(λ2) lA+ε _(B) ^(λ2) lB  (4)

$\begin{matrix}{{ODR}_{\lambda 1}^{\lambda 2} = \frac{{OD}^{\lambda 2}}{{OD}^{\lambda 1}}} & (5) \\{\frac{B}{A} = \frac{{ODR}_{\lambda 1}^{\lambda 2}\left( {1 - {\frac{ɛ_{A}^{\lambda 2}}{ɛ_{A}^{\lambda 1}}\frac{1}{{ODR}_{\lambda 1}^{\lambda 2}}}} \right)}{\frac{ɛ_{B}^{\lambda 2}}{ɛ_{A}^{\lambda 1}}\left( {1 - {\frac{ɛ_{B}^{\lambda 1}}{ɛ_{B}^{\lambda 2}}{ODR}_{\lambda 1}^{\lambda 2}}} \right)}} & (6)\end{matrix}$where OD^(λi) is the optical density measured at wavelength λ_(i); l ispath length; A, B are the respective concentrations of acid and baseforms of the reagent in the sample-reagent mixture; C_(T) is the totalreagent concentration in the sample-reagent mixture; ε_(A) ^(λ1), ε_(B)^(λi) are molar extinction coefficients at wavelength λ_(i) for A, B,respectively; and ODR_(λ1) ^(λ2) is the optical density ratio as definedin Equation (5).

The pH of a sample can be determined using spectral measurements bysubstituting Equation (6) in Equation (1). Because the acid and baseform concentrations appear only as a ratio in Equation (1) and theabsolute concentration of the reagent does not appear in Equations (1)or (5), the pH calculation is independent of the reagent concentrationand the volume of the reagent added to the sample. If the ionic strengthof the sample is at least an order of magnitude greater than the reagentconcentration in the reagent-sample mixture, then the ionic strength ofthe sample and the activity coefficients (see Equations (7) and (8)below) are independent of reagent concentration. Accordingly, the onlyrequirements for reagent addition are that the reagent concentration be(a) within a range where Beer's law is satisfied, (b) below an upperlimit depending on the buffer strength of the sample beyond which theaddition of the reagent could alter the sample pH, and (c) high enoughto allow a good signal-to-noise ratio.

The molar extinction coefficients for the acid and base forms areobtained by calibration using solutions having pH values wherein thereagent exists completely in either its acid form or its base form.Alternatively, if the total reagent concentration is known veryaccurately, pH may be determined by measuring absorption at a singlewavelength. However, because small errors in absolute concentration(C_(T)) can cause large errors in pH calculation, this method may notprovide an accurate pH measurement. The pH of a sample may also becalculated using a continuous spectral scan in the relevant region andapplying regression analysis to determine the base to acid ratio.

From Equation (1), as pH values move away from the pKa values of a givenreagent, the acid or the base fraction of the reagent becomes verysmall. Due to the low signal-to-noise ratios, the error in the pHmeasurement increases as pH values move away from the pKa value. Thus,for example, for a pH value 2 units lower than the pKa value, thefraction of the base form of the reagent is only 1%. Consequently, theOD corresponding to the base form peak wavelength is very low, resultingin inadequate pH accuracy. With single reagent indicators, the typicalrange of pH measurement is limited to about 1 to 1.5 units on eitherside of the reagent's pKa value. Beyond this range, a different reagentwith a more appropriate pKa value must be used. Accordingly, thespectroscopic technique is less flexible to implement because knowledgeof the sample's pH range is required a priori so that the appropriatereagent indicator is selected.

A commonly used pH indicator uses a mixture of reagents to extend therange of pH measurement. Visual observation of color allows pHdetermination to within 1 unit (see Vogel, “Text-Book of QuantitativeInorganic Analysis” 3^(rd) Edition, Chapter 1.30, page 59 (1961),incorporated by reference herein in its entirety). However, it isdifficult to obtain highly accurate measurements using spectroscopictechniques because the visible spectrum of the mixed reagent isgenerally a cumulative addition of the spectra of individual reagents.Unless the individual spectra are well resolved, it is difficult toinvert the fraction of each form for accurate pH calculation.

Additional factors must be considered when performing pH analysisdownhole. For example, only a limited number of reagents (pH indicators)can be transported downhole, the nature of the sample cannot bedetermined a priori, and only limited spectral analysis can be performeddownhole. Accordingly, it would be useful to have a broad pH indicatorthat allows for simple, yet accurate, pH determination. Further, it isdifficult to control the amount of reagent added to the sample underinvestigation in the downhole environment. Accordingly, a pH measurementthat is not dependent on reagent concentration would be preferred.

Accordingly, it is an object of the present invention to provide anindicator mixture that retains the advantages of the single reagentmethod and that is effective over a broad range of pH values.

It is a further object of the present invention to provide aspectroscopic technique to determine the pH of a sample with theaccuracy levels comparable to single reagent spectroscopy over a broadrange of pH values.

It is yet another object of the present invention to provide a reagentmixture suitable for use in a downhole environment.

SUMMARY OF THE INVENTION

The present invention relates to the use of a reagent mixture thatallows pH measurement over a broader range of pH than available usingconventional spectroscopic techniques. In one embodiment of the presentinvention, a fluids analyzer for determining the pH of formation fluidin a region of earth formation surrounding a borehole is disclosedcomprised of: a reagent container having a mixture of two or morereagents wherein the reagent mixture is capable of detecting either: (1)a pH range broader than each reagent individually or (2) pH moreaccurately than each reagent individually; and means for mixingformation fluid with the reagent mixture downhole. The fluids analyzermay further include a spectral analyzer means, coupled to receive amixture of formation fluid and the reagent-mixture from the mixing meansfor analyzing the optical density of the mixture of formation fluid andreagent mixture in two or more spectral channels. The reagent mixture iscapable of measuring pH to an accuracy of about 0.5 units or better.Typical downhole spectral analyzers use spectral channels havingbandwidths of approximately 10-20 nm.

A second embodiment of the present invention is a method of making areagent mixture for determining the pH of a sample comprising: (a)identifying a target pH range; (b) mixing known relative quantities oftwo or more reagents to create a reagent mixture, wherein the reagentmixture is capable of detecting either: (i) a pH range broader than eachreagent individually or (ii) pH to a better accuracy than the reagentsindividually; (c) optimizing the reagent mixture to identify one or moresets of reagents to be mixed that satisfy the targeted pH range; and (d)characterizing at least one set of reagents.

The sets of reagents may be optimized by identifying one or more sets ofreagents by carefully selecting the thermodynamic acid dissociationconstants of the reagents, adjusting the relative quantities of thereagents, or adjusting (the bandwidth and/or wavelength of) the spectralchannels. This optimization process may be performed by trial and error,or experimentation. It is noted that in some cases optimization may begenerally viewed as an error minimization technique; however,optimization may be performed to improve other parameters of interest,such as maximizing sensitivity of pH measurement or signal-to-noiseratio. Alternatively, forward models and algorithms may be developedbased on thermodynamic acid dissociation constants, relative quantities(or fractions), and the spectral channels. Once “optimal” reagent setsare identified, at least one of the sets should be characterized todetermine the detectable pH range of the mixture. Further, an erroranalysis should be performed to determine the accuracy of the mixture tomeasure pH. It is further noted that the absolute concentration of thereagent mixture may be optimized to improve signal-to-noise ratio andreduce the effects of error.

In a third embodiment, a method for determining the pH of formationfluid in a region of earth formation surrounding a borehole is disclosedcomprising: (a) storing a reagent mixture in a reagent container coupledto a fluids analyzer, wherein the reagent mixture is capable ofdetecting either: (i) a pH range broader than each reagent individuallyor (ii) pH to a better accuracy than each reagent individually; (b)positioning the fluids analyzer downhole; (c) drawing formation fluidinto the fluids analyzer; (d) mixing formation fluid and the reagentmixture; and (e) analyzing the optical density of said mixture offormation fluid and reagent mixture in one or more channels to determinethe pH of the formation fluid. If only one spectral channel is used, theabsolute concentration of the reagent mixture should also be determined.However, if two spectral channels are used, then it is not necessary todetermine the absolute concentration of the reagent mixture.

Accordingly, the present invention provides a pH indicator mixture forspectroscopic techniques that is accurate over a broader pH range (ascompared to conventional spectroscopic methods). As will be described indetail below, the method disclosed herein uses either (1) two or morespectral channels or (2) one spectral channel and accurate (absolute)reagent concentrations. If optical density (OD) measurements (ortransmission, absorption or other spectral measurements which may beconverted to OD) at two spectral channels are used, reagentconcentration in the sample-reagent mixture is not needed; instead therelative quantities (fractions) of the reagent in the mixture may beused. Furthermore, the reagents need not have well resolved individualspectra. In fact, the accuracy of the method is enhanced if the spectraof the acid and base forms of one reagent are substantially similar tothe spectra of the acid and base forms of the other, respectively.Because there is a vast pool of reagents to choose from, it isrelatively simple to pick reagents that show similar direction of colorchange with pH though at different pKa values. Accordingly, the presentinvention includes algorithms to optimize for the choice of reagents(i.e., their pKa values) based on the pH measurement range of interest.Further, the individual reagent fractions in the mixture may be selectedto obtain an optimized mixture over the pH range of interest. It isnoted that while the discussion that follows relates to the use of tworeagents, the method may be easily extended to three or more reagents.

For the purposes of the present invention, the term “optical techniques”is intended to apply to a broad range of techniques, including but notlimited to, spectroscopic, calorimetric, optical, etc. It is furthernoted that for the purposes of the present invention, the terms “pHsensitive reagent,” “reagent,” and “dye indicator” are usedinterchangeably.

Further advantages and novel features of the invention will be set forthin the description which follows.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a plot showing the spectra of a three-reagent mixture inbuffer solution with pH varying from 3 to 9.

FIGS. 2( a) and (b) are plots: (a) comparing model predicted pH fromexperimental ODR values of FIG. 1 with true buffer pH values (445 and570 nm wavelengths) and (b) showing the error in pH measurements as afunction of pH.

FIGS. 3( a) and (b) are plots: (a) showing a scenario where the acidform spectra of one reagent is identical to the base form spectra of theother and vice versa resulting in the pH being a non-unique function ofODR and (b) showing that pH is a unique function of ODR even when theacid and base forms of the two reagents have identical spectra.

FIG. 4 is a plot showing the error estimation for single and two-reagentmixtures, allowing estimation of target pH intervals for any desiredaccuracy level (see Table 2 below).

FIG. 5 is a plot showing the effect of changing the power p in theobjective function [see Equation (30) below].

FIG. 6 is a plot showing that the optimization of the mole fractions inthe three-reagent mixture yields better accuracy over the pH interval4-9 as compared to using equal mole or weight quantities.

FIG. 7 is a plot showing the change in optimum reagent quantities withchange in the target pH interval.

FIG. 8 is a plot showing the determination of the optimum pKa values foran equal weight mixture of three-reagents for various target pHintervals by optimizing objective function Equation (30) below.

FIGS. 9( a) and (b) are schematics describing the overall optimizationalgorithm.

FIG. 10 is a schematic showing one application of the present invention.

DETAILED DESCRIPTION

The present invention relates to a spectroscopic technique accurate overa broader pH range (as compared to conventional spectroscopic methods)using reagent mixtures. As will be described in detail below, the methoddisclosed herein uses either (1) two or more spectral channels or (2)one spectral channel and accurate reagent concentrations. If twospectral channels are analyzed, reagent concentration in thesample-reagent mixture is not needed; instead the relative quantities(fractions) of the reagent in the mixture may be used. Furthermore, thereagents need not have well resolved individual spectra. In fact, theaccuracy of the method is enhanced if the spectra of the acid and baseforms of one reagent are substantially similar to the spectra of theacid and base forms of the other, respectively. Because there is a vastpool of reagents to choose from, it is relatively simple to pickreagents that show similar direction of color change with pH though atdifferent pKa. Accordingly, the present invention includes algorithms tooptimize for the choice of reagents (i.e., their pKa values) based onthe pH measurement range of interest. Further, the individual reagentfractions in the mixture may be selected to obtain an optimized mixtureover the pH range of interest. It is noted that while the discussionthat follows relates to the use of two reagents, the method may beeasily extended to three or more reagents.

Equations (1) through (6) may be rewritten for two reagents as follows:

$\begin{matrix}{{pH} = {{pKa}_{1} + {\log\;\frac{\gamma_{B1}}{\gamma_{A1}}} + {\log\frac{B_{1}}{A_{1}}}}} & (7) \\{{pH} = {{pKa}_{2} + {\log\;\frac{\gamma_{B2}}{\gamma_{A2}}} + {\log\frac{B_{2}}{A_{2}}}}} & (8)\end{matrix}$C _(T1) =A ₁ +B ₁  (9)C _(T2) =A ₂ +B ₂  (10)

$\begin{matrix}{f_{1} = \frac{C_{T1}}{C_{T1} + C_{T2}}} & (11)\end{matrix}$OD ^(λ1)=ε_(A1) ^(λ1) lA ₁+ε_(B1) ^(λ1) lB ₁+ε_(A2) ^(λ1) lA ₂+ε_(B2)^(λ1) lB ₂  (12)OD ^(λ2)=ε_(A1) ^(λ2) lA ₁+ε_(B1) ^(λ2) lB ₁+ε_(A2) ^(λ2) lA ₂+ε_(B2)^(λ2) lB ₂  (13)

$\begin{matrix}{{ODR}_{\lambda 1}^{\lambda 2} = \frac{{OD}^{\lambda 2}}{{OD}^{\lambda 1}}} & (14)\end{matrix}$where A₁, B₁ are acid and base form concentrations, respectively, ofreagent 1 in the sample-reagent mixture; A₂, B₂ are acid and base formconcentrations, respectively, of reagent 2 in the sample-reagentmixture; C_(T1), C_(T2) are total concentrations of reagent 1 andreagent 2, respectively, in the sample-reagent mixture; ƒ₁ is the molefraction of reagent 1 in the reagent mixture; pKa₁, pKa₂ aredissociation constants for reagents 1 and 2, respectively.

From Equations (7) through (14):

$\begin{matrix}{{{ODR}_{\lambda 1}^{\lambda 2} = {{\frac{\sum\limits_{i}{\frac{B_{i}}{B_{1}}\frac{ɛ_{Bi}^{\lambda 2}}{ɛ_{B1}^{\lambda 2}}\left( {1 + {\frac{ɛ_{Ai}^{\lambda 2}}{ɛ_{Bi}^{\lambda 2}}10^{- {({{p\; H} - {pKa}_{i}})}}}} \right)}}{\sum\limits_{i}{\frac{B_{i}}{B_{1}}\frac{ɛ_{Ai}^{\lambda 1}}{ɛ_{Bi}^{\lambda 2}}\frac{ɛ_{Bi}^{\lambda 2}}{ɛ_{B1}^{\lambda 2}}\left( {10^{- {({{p\; H} - {pKa}_{i}})}} + \frac{ɛ_{Bi}^{\lambda 1}}{ɛ_{Ai}^{\lambda 1}}} \right)}}\mspace{14mu}{for}\mspace{14mu} i} = 1}},2} & (15)\end{matrix}$where

$\begin{matrix}{\frac{B_{2}}{B_{1}} = {\frac{1 + 10^{{- {({{p\; H} - {pKa}_{1}})}}\mspace{11mu}}}{{1 + 10^{- {({{p\; H} - {pKa}_{2}})}}}\;}\frac{\left( {1 - f_{1}} \right)}{f_{1}}}} & (16)\end{matrix}$Hence:ODR _(λ1) ^(λ2)=ƒ(pH, ε, pKa ₁ , pKa ₂, ƒ₁)  (17)whereε=(ε_(A1) ^(λ1), ε_(B1) ^(λ1), ε_(A1) ^(λ2), ε_(B1) ^(λ2), ε_(A2) ^(λ1),ε_(B2) ^(λ1), ε_(A2) ^(λ2), ε_(B2) ^(λ2))  (18)

From Equation (17), which is an analytical equation, once the reagentsfor the two-reagent mixture are chosen, the relative quantities, andwavelengths (width of the spectral channel) are selected, the ODRbecomes a function only of the pH. It is independent of absolute reagentconcentrations or volume of reagent mixture added to sample, andtherefore retains the advantage of the single reagent measurement. Themixture may be characterized in terms of ODR and pH such that plots andlook-up tables may be generated. Alternatively, Equation (17) may beinverted to express pH as an analytical function of ODR (such as byusing a program like Mathematica by Wolfram Research, Inc.):pH=ƒ(ODR _(λ1) ^(λ2) , ε, pKa ₁ , pKa ₂, ƒ₁)  (19)

Equations (7) through (19) can be extended to a system of n reagents:

$\begin{matrix}{{{ODR}_{\lambda 1}^{\lambda 2} = {{\frac{\sum\limits_{i}{\frac{B_{i}}{B_{1}}\frac{ɛ_{Bi}^{\lambda 2}}{ɛ_{B1}^{\lambda 2}}\left( {1 + {\frac{ɛ_{Ai}^{\lambda 2}}{ɛ_{Bi}^{\lambda 2}}10^{- {({{p\; H} - {pKa}_{i}})}}}} \right)}}{\sum\limits_{i}{\frac{B_{i}}{B_{1}}\frac{ɛ_{Ai}^{\lambda 1}}{ɛ_{Bi}^{\lambda 2}}\frac{ɛ_{Bi}^{\lambda 2}}{ɛ_{B1}^{\lambda 2}}\left( {10^{- {({{p\; H} - {pKa}_{i}})}} + \frac{ɛ_{Bi}^{\lambda 1}}{ɛ_{Ai}^{\lambda 1}}} \right)}}\mspace{14mu}{for}\mspace{14mu} i} = 1}},n} & (20) \\{{\frac{B_{i}}{B_{1}} = {{\frac{1 + 10^{{- {({{p\; H} - {pKa}_{1}})}}\mspace{11mu}}}{{1 + 10^{- {({{p\; H} - {pKa}_{i}})}}}\;}\frac{f_{i}}{f_{1}}\mspace{236mu}{for}\mspace{14mu} i} = 1}},n} & (21)\end{matrix}$ODR _(λ1) ^(λ2)=ƒ(pH, ε, pKa ₁ , pKa ₂ . . . pKa _(n), ƒ₁ , ƒ ₂ . . .ƒ_(n))  (22)where:ε=(ε_(A1) ^(λ1), ε_(B1) ^(λ1), ε_(A1) ^(λ2), ε_(B1) ^(λ2), ε_(A2) ^(λ1),ε_(B2) ^(λ1), ε_(A2) ^(λ2), ε_(B2) ^(λ2) . . . ε_(An) ^(λ1), ε_(Bn)^(λ1), ε_(An) ^(λ2), ε_(Bn) ^(λ2))  (23)Hence:pH=ƒ(ODR _(λ1) ^(λ1) , ε, pKa ₁ , pKa ₂ . . . pKa _(n) , ƒ ₁ , ƒ ₂ . . .ƒ _(n))  (24)It is noted that Equations (22) and (24) are analytical expressions.

FIG. 1 shows experimentally measured spectra for a three-reagent mix inpH buffers 3-9. Arrow A indicates decrease in OD of acid forms ofreagents as buffer pH increases from 3 to 9. Arrow B indicates increasein OD of base forms of the reagents as buffer pH increases from 3 to 9.Reagent properties of these mixtures are summarized in Table 1.

FIG. 2( a) compares model predicted pH values calculated using measuredODR values of FIG. 1 with true pH values of the buffer solutions. FIG.2( b) plots the experimental error at various pH values. The reagentmixture of the example of FIG. 2( b) is accurate over the range ofbuffers used (pH 3-9) with the errors within 0.06 pH units. Accordingly,the reagent mixture of the present invention is accurate over a broaderpH range than the traditional single reagent indicators, which typicallywork over 2-3 pH units (see, for example, Table 2 below).

TABLE 1 Summary of reagent properties used in simulations Phenol RedChlorophenol Red Bromophenol Blue (reagent 1) (reagent 2) (reagent 3)Acid Base* Acid Base* Acid Base* ε at 570 nm (λ₂) 108 37975 58 54247 37846859 ε at 445 nm (λ₁) 17916 3352 18136 1985 21711 1981 Mol. wt. 354.38376.36 423.28 445.26 669.98 691.97 pKa 7.79 6.11 4.11 *The base form isa sodium salt of the reagent.

The pH as calculated from Equation (24), however, is not necessarilyalways a unique function of ODR. FIG. 3( a) is a plot showing tworeagents (pKa₁=7.79, pKa₂=6.11, ƒ₁=0.5) that are exact mirror images ofeach other; in this example, the spectrum of the acid form of onereagent is identical to the spectrum of the base form of the secondreagent and vice versa (ε_(A1) ^(λj)=ε_(B2) ^(λj); ε_(A2) ^(λj)=ε_(B1)^(λj) for all j). For each pH value there is a unique ODR. However, theinverse is not true; for a given ODR, there are two pH values and themethod fails. By choosing reagents that show common direction of colorchange with pH (but at different pKa values), the sensitivity of the pHto ODR may be increased to obtain a unique solution.

FIG. 3( b) shows the pH vs. ODR plot for two reagents (pKa₁=7.79,pKa₂=6.11, ƒ₁=0.5) with identical spectra for its acid and base forms(ε_(A1) ^(λj)=ε_(A2) ^(λj); ε_(B1) ^(λj)=ε_(B) ^(λj) for all j). Here,the present invention works well. These results are contrary toconventional thinking where good spectral resolution would be preferredto calculate pH by inverting the spectra of the mixture for acid andbase fractions of each reagent.

Like the single reagent measurement, the mixture of the presentinvention is independent of total amount of reagent added to the sample.Accordingly, the present methodology is easy to implement in batch orflow injection mode for measuring pH of aqueous samples. The method uses(1) a minimum of two spectral channels if concentration independence isdesired or (2) one spectral channel and accurate reagent concentrations.The latter is very sensitive to absolute reagent concentrations and,hence, is potentially less robust. Alternatively, pH may be calculatedusing regression analysis, if spectral absorption (OD) data at more thantwo wavelengths or continuous scans are available.

Error Propagation and Analysis in pH Measurement

As mentioned above, a single reagent is sensitive only over a limited pHrange around its pKa value. The extent of this range is determined bythe accuracy required in the pH measurement and the spectroscopic noise.An error analysis should be performed to determine the measurable rangeas a function of these two parameters for single reagents and mixedreagents. An error analysis can also be performed to optimize for one ormore of: the choice of reagents, relative quantities of the reagents, orspectral channels.

The method of error propagation is used to determine the standarddeviation in pH measurement as a function of spectroscopic noise(standard deviation in OD) (Bevington et al., “Data Reduction and ErrorAnalysis for the Physical Sciences,” 3^(rd) Edition, Chapter 3, pages36-41, (2003), incorporated by reference herein in its entirety).

For x=ƒ(u,υ), the standard deviation in x (σ_(x)) as a function ofstandard deviations in u (σ_(u)) and ν(σ_(v)) is given as:

$\begin{matrix}{\sigma_{x} \cong \sqrt{{\sigma_{u}^{2} \cdot \left( \frac{\partial x}{\partial u} \right)^{2}} + {\sigma_{v}^{2} \cdot \left( \frac{\partial x}{\partial v} \right)^{2}}}} & (25)\end{matrix}$

For a given reagent mixture (fixed pKa_(i), ε, ƒ_(i)) and for a givenset of wavelengths (λ₁, λ₂), the error propagation algorithm may beapplied to Equations (20) and (24):

$\begin{matrix}{\sigma_{{ODR}_{\lambda 1}^{\lambda 2}} = {{ODR}_{\lambda 1}^{\lambda 2} \cdot \sqrt{\left( \frac{\sigma_{{OD}^{\lambda 2}}}{{OD}^{\lambda 2}} \right)^{2} + \left( \frac{\sigma_{{OD}^{\lambda 1}}}{{OD}^{\lambda 1}} \right)^{2}}}} & (26) \\{\sigma_{p\; H} = {\frac{\partial{pH}}{\partial{ODR}_{\lambda 1}^{\lambda 2}} \cdot \sigma_{{ODR}_{\lambda 1}^{\lambda 2}}}} & (27)\end{matrix}$

Combining Equations (26) and (27), standard deviation in pH (σ_(pH))measurement is obtained as a function of spectroscopic noise at the twowavelengths λ₁ and λ₂:

$\begin{matrix}{\sigma_{p\; H} = {\frac{{\partial p}\; H}{\partial{ODR}_{\lambda 1}^{\lambda 2}} \cdot {ODR}_{\lambda 1}^{\lambda 2} \cdot \sqrt{\left( \frac{\sigma_{{OD}^{\lambda 2}}}{{OD}^{\lambda 2}} \right)^{2} + \left( \frac{\sigma_{{OD}^{\lambda 1}}}{{OD}^{\lambda 1}} \right)^{2}}}} & (28)\end{matrix}$

The derivative of pH with respect to ODR may be determined using theanalytical expression of Equation (24) (which may be determined byinverting Equation (22) (such as by using packages such as Mathematicaby Wolfram Research, Inc.).

Alternatively, because the expression is very long, the derivative fromEquation (22) may be numerically calculated provided ODR is a continuousfunction of pH and differentiable at every point in the interval ofinterest.

$\begin{matrix}{\frac{{\partial p}\; H}{\partial{ODR}_{\lambda 1}^{\lambda 2}} = \frac{1}{\frac{\partial{ODR}_{\lambda 1}^{\lambda 2}}{{\partial p}\; H}}} & (29)\end{matrix}$

FIG. 4 compares the standard deviation in pH as a function of standarddeviation in OD (where spectroscopic noise is assumed to be 0.01 ODunits and C_(T) is 2×10⁻⁵ M) for single reagents and for equal weightfraction mixture of the two reagents, PR and CPR from Table 1. Thisfigure allows the measurable pH range to be estimated for a desiredaccuracy as a function of spectroscopic noise. Accordingly, thetwo-reagent mixture of this example allows measurement over a rangelonger than the single reagents mixtures (see also Table 2). It is notedthat the addition of a third reagent will allow further extension of themeasurement range.

TABLE 2 Extending range of pH measurements with reagent mixtures for 0.1pH unit desired accuracy assuming spectroscopic noise of 0.01 OD unitsReagent Mole Fraction (f₁, f₂, f₃) C_(T), [M] pH range PR 1.0, 0.0, 0.02 × 10⁻⁵ 6.6-8.7 CPR 0.0, 1.0, 0.0 2 × 10⁻⁵ 4.7-7.0 BB 0.0, 0.0, 1.0 2 ×10⁻⁵ 2.8-5.1 PR-CPR 0.55, 0.45, 0.0 2 × 10⁻⁵ 5.1-8.2 (equal weightfractions) PR-CPR 0.55, 0.45, 0.0 4 × 10⁻⁵ 4.8-8.6 (equal weightfractions) PR-CRP-BB 0.42, 0.35, 0.23 2 × 10⁻⁵ 3.6-7.9 (equal weightfractions) PR-CRP-BB 0.46, 0.26, 0.28 2 × 10⁻⁵ 3.5-8.1 (optimized for pH3.5 to 8) PR-CRP-BB 0.42, 0.35, 0.23 4 × 10⁻⁵ 3.2-8.5 (equal weightfractions)

From Equation (28), assuming equal noise at two wavelengths (σ_(OD)_(λ1) =σ_(OD) _(λ2) =σ_(OD)), σ_(pH) increases linearly with σ_(OD).Note also that while the pH calculation is independent of absolutereagent concentrations, the error in the pH measurement depends onabsolute reagent concentration through the absolute OD values thatappear in Equation (28). For a given reagent mixture with a fixedrelative quantity of the individual reagents, the error in pH, σ_(pH),decreases linearly with increasing absolute reagent concentration.However, as explained above, if concentration of the reagents added isvery high, then concentration could affect the pH of the sample andintroduce additional errors. Furthermore, the concentration may gobeyond the range where Beer's Law is valid.

Optimization of Reagent Mixtures

Using the error estimation algorithm described above, the reagent molefraction in the mixture may be optimized to minimize the error over adesired pH range. A possible formulation for the objective function fordesired accuracy of 0.1 pH units, for example, over the interval pH₁ topH₂, could include:

$\begin{matrix}{{{Minimize}\mspace{14mu}{F\left( {f_{1},f_{2},\;{\ldots\mspace{11mu} f_{n}}} \right)}} = {{\sum\limits_{i = 1}^{m}\;{{w_{i}\left( {\sigma_{p\; H_{i}} - 0.1} \right)}^{p}\mspace{14mu}{for}\mspace{14mu}{all}\mspace{14mu}\sigma_{p\; H_{i}}}} \geq 0.1}} & (30)\end{matrix}$where m is the number of discrete points into which the interval betweenpH₁ and pH₂ is divided and w_(i) is the weight applied to the errorcontribution at each point. Both w_(i) and p may be chosen to adjust thecontribution of the error at each pH value in the desired range. Thismethod provides the flexibility of having different levels of accuracywithin a broader constraint of 0.1 pH units error. For example, byassigning a higher weight to the points in the interval between 5 and 6,one can optimize for 0.1 unit accuracy over the entire range of 4 to 9with a higher level of accuracy between 5 and 6.

FIG. 5 shows the effect of varying power p with w_(i) equal to one whenoptimizing over a pH range of 4-9 for a three-reagent mixture (reagentproperties are summarized in Table 1). At pH equal to 9, the deviationfrom 0.1 units is very high. By using a power of 1, the contribution oferror at 9 to the objective function Equation (30) is 0.27 units and isabout 9 times higher than the contribution of the error at pH 5 (0.03units). However, if the power p is 0.2, the contribution to theobjective function of the error at pH 9 (0.77 units) is only 1.54 timeshigher as compared to the objective function error at pH 5 (0.5 units).In the second case with power p equal to 0.2, the optimization algorithmgives nearly equal importance to minimizing the error at pH 5 and pH 9,while in the first case the pH 9 error term dominates and theoptimization algorithm ignores the error at pH 5. This is evident in theplots for the two cases.

While this is one form of the optimization function, one skilled in theart would recognize that other algorithms may be used to optimizereagent mixtures.

Standard minimization routines (such as the non-gradient simplex oramoeba DUMPOL algorithm in IMSL package from Visual Numerics, Inc.) canbe used for the optimization of reagent mole fractions in the mixture.

FIG. 6 shows the results of a three-reagent mixture optimized for pHrange of 4 to 9 and compares with cases when equal weight and equal molefractions are used. [Spectroscopic noise is assumed to be 0.01 OD unitsand total reagent concentration is 2×10⁻⁵ M. For Equation (30), p is 0.5and w_(i) is 1.]

FIG. 7 shows how the optimization algorithm (see Equation (30)) adjustsmole fractions of the reagents in the mixture as the pH range ofinterest changes. As the pH range (pH 4-9) is shifted to a smallerinterval of pH 6-9, the fraction of the reagent 1 (pKa=7.79) increases,while that of reagent 3 (pKa=4.11) falls to zero. [Spectroscopic noiseis again assumed to be 0.01 OD units and total reagent concentration is2×10⁻⁵ M. For Equation (30), p is 0.5 and w_(i) is 1.]

As discussed above, it is possible to obtain reagent combinations wherethe pH is a non-unique function of ODR. To prevent this, it isrecommended that when a set of reagents are chosen, the mixture isforward modeled with known relative quantities or mole fractions ofreagents to calculate pH as a function of ODR. The plot can be visuallyinspected or algorithms may be used to inspect the pH values to checkfor uniqueness. Generally, it is expected that when reagents in themixture have different pKa values but their acid and base forms showsimilar color transformations with pH (for example, colors of allreagents changing from yellow to blue/red as they go from acid to base),the reagent combination should provide a unique pH vs. ODR plot.

It is also possible to optimize the reagent selection process (with afinal check being done as discussed above for uniqueness). Thus, for afixed mole fraction, pKa values of the reagents in the mixture may beoptimized so as to maximize accuracy in the pH interval of interest.FIG. 8 lists optimum sets of pKa values of reagents in a three-reagentmixture for different pH intervals of interest. [For Equation (30), p is0.5 and w_(i) is 1.] For this example, the three-reagents had equalweight fractions, and epsilon values were fixed as provided in Table 1.

Reagents may also be chosen to allow pH measurement over discontinuouspH intervals of interest. Thus, in a two-reagent mixture of phenol red(pKa=7.79), for example, and bromophenol blue (pKa=4.11) where the pKavalues are separated by more than 3 units, the pH intervals on the lowend (2.8-5.1 units) and the high end (6.6-8.7) may be simultaneouslytargeted without any sensitivity for regions in between.

The general method of making and optimizing the pH indicator mixture isdescribed in FIGS. 9( a) and (b). As shown in FIG. 9( a), first a targetpH range is selected 900. Then, known relative quantities of the two ormore reagents are mixed 910. The reagents are selected such that whenmixed, the reagents cover a broader pH range or improved accuracy thanif the reagents were used individually. It is noted that the presentmethod does not require that absolute concentrations of the reagents beknown; knowledge of relative (or fractional) quantities is sufficient.The reagent mixture is then optimized (for example, by trial and error,experimentation, or using forward modeling) to identify one or more setsof reagents that satisfy the target pH range 920. Once optimized reagentsets are identified, one or more of the reagent sets may becharacterized to be used for spectroscopic pH measurement 930 (such asby developing functions of pH, OD, ODR, error deviations, etc.).

A non-limiting preferred algorithm is shown in FIG. 9( b). As in FIG. 9(a), a pH target range is identified 900 and known quantities of two ormore reagents are mixed 910. Boxes 920 a-920 _(f) describe a preferredmethod of optimizing the reagent mixtures. First, a forward model isdeveloped 920 a based on the three variables: (1) the thermodynamic aciddissociation constants which are dependent on the reagents selected; (2)the relative quantities of the reagents (it may be simplest to beginwith equal quantities of reagents); and (3) the identification of two ormore spectral channels wherein the reagents show elevated levels ofoptical densities. It may be preferred to identify common channelswherein all of the reagents show elevated levels of optical density.Next, an algorithm is developed 920 b based on the forward model of 920a to identify sets of reagents having optimized thermodynamic aciddissociation constants. (It is noted that reagents having the exactthermodynamic acid dissociation constants as optimized may not beavailable. Accordingly, an “optimized” reagent set will include reagentshave thermodynamic acid dissociation constants within acceptable rangeof the optimal value. Accordingly, numerous acceptable reagent sets maybe identified.)

The procedure is then repeated for the optimized set of reagents 920c-920 d using the optimized thermodynamic acid dissociation constants,relative weight fractions, and spectral channels. However, now thereagent sets are optimized to determine the optimal relative weightfractions for the reagent sets identified in 920 b. The procedure isrepeated once more for the optimized set of reagents 920 e-920 f usingthe optimized thermodynamic acid dissociation constants, the optimizedrelative weight fractions, and spectral channels. But, now the reagentsets are optimized to determine the optimal spectral channels for thereagent sets identified in 920 d.

It is noted that each level of optimization need not be performed. Onemay chose to optimize for one or more (but not necessarily all) of: thethermodynamic equilibrium constants, relative quantities, or spectralchannels at any time as shown by the dotted arrow to the left. At anypoint in the process, the optimized reagent sets may be checked for aunique correlation of pH as a function of ODR 930 a and characterizedfor later use for spectroscopic pH measurement 930 b. It is noted thatthe absolute concentration of the reagent mixture may also be adjustedto improve error (i.e., the signal to noise ratio.)

Apparatus Example

The present invention may be implemented in a laboratory or in variousdownhole fluid analysis tools. For example, the apparatus described incommonly owned co-pending U.S. patent application Ser. No. 10/667,639filed Sep. 22, 2003, entitled “Determining Fluid Chemistry of FormationFluid by Downhole Reagent Injection Spectral Analysis” (incorporated byreference herein in its entirety) is a preferred implementation of thepresent reagent mixture.

One non-limiting embodiment of the present invention, as shown in FIG.10, is a wireline formation tester 1015, including fluids analyzer 1020.The formation tester is shown downhole within borehole 1012 of formation1010 suspended by logging cable 1017. Logging cable 1017 also couplesthe formation tester to surface system 1018. Fluids analyzer 1020 islocated within formation tester 1015. Means for extracting fluid fromthe formation, in this case a probe 1021, is shown extending from theformation tester 1015. Major elements of fluids analyzer 1020 are fluidflow-line 1030, reagent container 1031, and spectral analyzer 1041. Thisembodiment further uses a flow-line pump (dual chamber piston pump) 1051and main pump-out line 1061. It is noted that this figure is intended todepict a non-limiting embodiment useful for deploying the presentinvention. Other suitable elements may be included as dependent upon thespecific application. For example, other configurations may be used toextract fluids from the formation, such as in a producing well or amonitoring well where a pump is used to obtain fluid samples.Accordingly, while FIG. 10 depicts a wireline application, the presentinvention may be deployed in other scenarios, such as permanentinstallations or a drilling environment.

While the invention has been described herein with reference to certainexamples and embodiments, it will be evident that various modificationsand changes may be made to the embodiments described above withoutdeparting from the scope and spirit of the invention as set forth in theclaims.

1. A method of identifying one or more sets of reagents wherein the one or more sets of reagents is used for determining the pH of a sample, the method comprising: a. identifying a target pH measurement range of the sample and a target pH accuracy; b. identifying a plurality of reagents based on known reagent thermodynamic acid dissociation constants and spectral characteristics such that their combination is expected to satisfy the targeted pH range of the sample; c. identifying one or more spectral channels to make the pH measurement wherein the reagents have elevated optical densities; d. mixing known relative concentrations of two or more reagents of the plurality of reagents to create one or more sets of reagents; e. characterizing at least one reagent set of the one or more sets of reagents wherein characterizing includes developing a relationship between optical density ratio and pH based on the thermodynamic acid dissociation constants of the reagents, relative concentrations of the reagents, and one or more spectral channels; f. identifying the spectroscopic noise of a spectral analyzer to be used for the pH measurement; g. performing an error analysis for at least one reagent set of the one or more sets of reagents wherein the error analysis comprises developing a relationship between standard deviation in pH and spectroscopic noise in optical density based on the relation developed in step (e); h. optimizing the one or more sets of reagents with an optimization algorithm based on the developed relationship in step (g) to satisfy the target pH accuracy over the target pH measurement range of the sample and determine one of optimum values for relative concentrations or spectral channels or both; and i. characterizing the one or more optimized reagent set.
 2. The method of claim 1, further comprising the step of characterizing the at least one of the one or more sets of optimized reagents by developing a relationship between optical density ratio and pH using the optimized parameters.
 3. The method of claim 2, further comprising checking for uniqueness of the correlation between optical density ratio and pH.
 4. The method of claim 2, wherein the one or more optimized sets of reagents is suitable for use in a downhole environment, the method further comprising: a. storing the optimized set of reagents in a reagent container coupled to a fluids analyzer, wherein said reagent mixture is capable of detecting a pH range broader than each reagent individually; b. positioning the fluids analyzer downhole; c. drawing formation fluid into the fluids analyzer; d. mixing formation fluid with the reagent mixture; and e. analyzing the optical density of said mixture of formation fluid and reagent mixture in one or more spectral channels to determine the pH of the formation fluid.
 5. The method of claim 4, wherein said pH is determined to an accuracy of 0.5 pH units or less.
 6. The method of claim 4, wherein analyzing the optical density is performed using two or more channels.
 7. The method of claim 6, further comprising analyzing the optical density ratio.
 8. The method of claim 4, comprising obtaining optical measurements in three or more channels and performing a regression analysis using said optical measurements.
 9. The method of claim 1, further comprising optimizing absolute concentration of the one or more sets of reagents.
 10. The method of claim 1, wherein the reagents show similar direction of spectral shift with changes in pH.
 11. The method of claim 1, wherein identifying the spectroscopic noise includes one of signal to noise ratio of spectral signal or standard deviation and the optical density. 